#ifndef __INCLUDED_CBL_SERIALIZATION_H__
#error "CBL_Serialization.hpp must not be used directly. Use CBL_Serialization.h instead."
#else
#ifndef __INCLUDED_CBL_SERIALIZATION_HPP__
#define __INCLUDED_CBL_SERIALIZATION_HPP__

template <typename TType>
CB_FORCEINLINE void CB_INLINE_ATTR ISerializer::Serialize(std::vector<TType>& _rVector, const char* _pBlockName, const char* _pElementName, uint32 _Flags)
{
    SerializeBlockStart(_pBlockName);
    
    if (IsReading())
    {
        bool ResultOk;
        do
        {
            TType SubObject;
            ResultOk = Serialize(SubObject, _pElementName, ISerializer::FlagCollectionItem);
            if (ResultOk) _rVector.push_back(SubObject);
        }
        while (ResultOk);
    }
    else
    {
        uint32 VectorSize = _rVector.size();
        for (uint32 Element(0); Element<VectorSize; ++Element)
        {
            Serialize(_rVector[Element], _pElementName, ISerializer::FlagCollectionItem);
        }
    }
    
    SerializeBlockEnd(_pBlockName);
}

#endif
#endif